
import { ChangeDetectionStrategy, Component, Input } from '@angular/core';
import { CommonModule } from '@angular/common';
import { MatIconModule } from '@angular/material/icon';
import { MatMenuModule } from '@angular/material/menu';
import { MatButtonModule } from '@angular/material/button';
import { TranslatePipe, TranslateDirective } from '@ngx-translate/core';
import { of } from 'rxjs';

@Component({
  selector: 'cne-user-menu',
  standalone: true,
  imports: [CommonModule, MatIconModule, MatMenuModule, MatButtonModule, TranslatePipe, TranslateDirective],
  templateUrl: './user-menu.component.html',
  styleUrls: ['./user-menu.component.scss'],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class UserMenuComponent {

  @Input() displayUserInfo: boolean = true;

  // 使用静态可观察对象以兼容现有模板 (async 管道)
  authority$ = of(true);
  authorityName$ = of('user.sys-admin');
  userDisplayName$ = of('Admin');

  openAccount(): void {
    // 静态模式下暂不跳转
  }

  logout(): void {
    // 静态模式下暂不登出
  }

}
